package com.thb.pay.api.sys.fallback;

import com.thb.pay.api.sys.SysUserServiceApi;
import com.thb.pay.api.sys.vo.req.SysUserPageReq;
import com.thb.pay.api.sys.vo.req.SysUserReq;
import com.thb.pay.api.sys.vo.req.SysUserRoleReq;
import com.thb.pay.api.sys.vo.resp.SysUserRoleVo;
import com.thb.pay.api.sys.vo.resp.SysUserVo;
import com.thb.pay.core.utils.PageResult;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Slf4j
@Component
public class SysUserServiceApiFallbackFactory implements FallbackFactory<SysUserServiceApi> {


    @Override
    public SysUserServiceApi create(Throwable throwable) {
        return new SysUserServiceApi() {

            @Override
            public PageResult<SysUserVo> findPage(@RequestBody SysUserPageReq pageReq) {
                return null;
            }

            @Override
            public void addUser(@RequestBody SysUserReq sysUser) {

            }

            @Override
            public void updateUser(@RequestBody SysUserReq sysUser) {

            }

            @Override
            public SysUserVo getByUserId(@RequestParam("userId") Long userId) {
                return null;
            }

            @Override
            public SysUserVo getByUserName(@RequestParam("userName") String userName) {
                return null;
            }

            @Override
            public void deleteBatchUserIds(@RequestBody List<Long> userIds) {

            }

            @Override
            public void addUserRoles(@RequestBody SysUserRoleReq userRoleReq) {

            }

            @Override
            public List<SysUserRoleVo> findUserRolesByUserId(@RequestParam("userId") Long userId) {
                return null;
            }
        };
    }
}